<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>提现</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no"/>
	    <meta http-equiv="Access-Control-Allow-Origin" content="*">
	    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
		<link rel="stylesheet" href="../css/base.css" />
		<link rel="stylesheet" href="../css/tixian.css" />
		<script src="../js/jquery-2.2.3.min.js"></script>
		<script type="text/javascript" src="../js/rem.js"></script>
	</head>
	<body>
		<div class="header">
			<a href="javascript:history.back(-1)"><img src="../img/g_next.png" alt="" /></a>
			提现
		</div>
		<div class="tixian_main">
			<div class="tixian_fangShi">
				<img class="FS" src="../img/g_tixian_wx.png" alt="" />
				<div class="name">
					
					<p class="two">微信零钱</p>
				</div>
				<img class="right" src="../img/icon-right.png" alt="" />
			</div>
			<div class="tixian_jinE">
				<p class="tixian_TS">请输入提现金额</p>
				<input class="tixian_inp" type="text" placeholder="￥" />
				<p class="tixian_XZ">本次可提现1222.22元<span>全部提现</span></p>
			</div>
		</div>
		<p class="tixian_DZ">提现免手续费，预计1-3个工作日到账</p>
		<input type="button" value="下一步" class="tixian_btn" />
		<div class="overlay">
			<div class="tixian_FS_XZ">
				<p class="title">提现到</p>
				<lu class="tixian_FS_XZ_ul">
					<li class="tixian_FS_XZ_li">
						<img src="../img/g_tixian_afb.png" alt="" />
						<span>支付宝账户（3756）</span>
					</li>
					<li class="tixian_FS_XZ_li">
						<img src="../img/g_tixian_wx.png" alt="" />
						<span>微信零钱</span>
					</li>
					<li class="tixian_FS_XZ_li">
						<img src="../img/g_tixian_yh.png" alt="" />
						<span>招商银行（3756）</span>
					</li>
				</lu>
				<div class="tixian_tj">
					<img  src="../img/G_tixian_tj.png"/>
					<span>添加新卡</span>
				</div>
			</div>
			<div class="tixian_password">
				<p class="title">输入支付密码</p>
				<img class="gb" src="../img/g_tixian_gb.png" alt="" />
				<div class="input f_l">
					<input class="MM inpVal1" style="border-left:1px solid #909090;" type="password" class="" maxlength="1">
					<input class="MM inpVal2" type="password" maxlength="1">
					<input class="MM inpVal3" type="password" maxlength="1">
					<input class="MM inpVal4" type="password" maxlength="1">
					<input class="MM inpVal5" type="password" maxlength="1">
					<input class="MM inpVal6" type="password" maxlength="1">
				</div>
				<a href="#" class="WJ_password">忘记密码?</a>
			</div>
			
		</div>
	</body>
	<script>
		$(function(){
			$('.tixian_fangShi').click(function(){
				$('.overlay').show();
				$('.tixian_FS_XZ').show();
			});
			$('.tixian_btn').click(function(){
				$('.overlay').show();
				$('.tixian_password').show();
			})
			$('.tixian_password .gb').click(function(){
				$('.overlay').hide();
			})
			$('.tixian_FS_XZ_li').click(function(){
				var src = $(this).find("img").attr("src");
				var _text = $(this).find("span").text();
				$('.tixian_fangShi .FS').attr("src",src);
				$('.tixian_fangShi .name .two').text(_text);
				$('.overlay').hide();
			})
		})
	</script>
	<script>

/*模拟支付宝的密码输入形式*/
				(function(window, document) {					
					var active = 0,
						inputBtn = document.getElementsByClassName('MM');
					for(var i = 0; i < inputBtn.length; i++) {
						inputBtn[i].addEventListener('click', function() {
							inputBtn[active].focus();
						}, false);
						inputBtn[i].addEventListener('focus', function() {
							this.addEventListener('keyup', listenKeyUp, false);
						}, false);
						inputBtn[i].addEventListener('blur', function() {
							this.removeEventListener('keyup', listenKeyUp, false);
						}, false);
					}

					/*监听键盘的敲击事件*/
					function listenKeyUp() {
						if(!isNaN(this.value) && this.value.length != 0) {
							if(active < 5) {
                                console.log(active);
                                active += 1;
							}else if(active == 5){
                                console.log(333);
                                var int  = document.getElementsByClassName('MM ')
								var srt = ''
                                for(i =0;i<int.length;i++){
                                    srt += int[i].value
                                }
                                console.log(srt);
                            }
							inputBtn[active].focus();
                        } else if(this.value.length == 0) {
                            console.log(2222);
							if(active > 0) {
								active -= 1;
							}
							inputBtn[active].focus();
						}
					}

					
				})(window, document);
				

			
			
		</script>
</html>
